negotiator.analysis
Class BidPoint

java.lang.Object
  extended by negotiator.analysis.BidPoint
Direct Known Subclasses:
BidPointTime

public class BidPoint
extends java.lang.Object

A BidPoint is a tuple which contains the utility of a particular bid for each agent.

Author:
Tim Baarslag, Dmytro Tykhonov, Mark Hendrikx

Constructor Summary
BidPoint(Bid bid, java.lang.Double... utility)
          Create a BidPoint by given the bid and the tuple of utilities for that bid.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 Bid getBid()
          Bid from which the utilities are represented.
 double getDistance(BidPoint other)
          Returns the distance between this BidPoint and another BidPoint.
 java.lang.Double getUtility(int index)
          Returns the utility of the bid for the i'th agent (agent A = 0, etc.).
 java.lang.Double getUtilityA()
          Returns the utility of the bid for agent A.
 java.lang.Double getUtilityB()
          Returns the utility of the bid for agent B.
 int hashCode()
           
 boolean isStrictlyDominatedBy(BidPoint other)
          Returns true if this BidPoint is strictly dominated by another BidPoint.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BidPoint

public BidPoint(Bid bid,
                java.lang.Double... utility)
Create a BidPoint by given the bid and the tuple of utilities for that bid.

Parameters:
bid - from which the utilities are stored.
utility - tuple of utilities of the bid.
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
string representation of the object.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
Parameters:
obj - object to which this object is compared.
Returns:
true if this object is equal to the given object.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
hashcode of this object.

getBid

public Bid getBid()
Bid from which the utilities are represented. This bid may be null to save memory.

Returns:
bid which utilities are represented.

getUtility

public java.lang.Double getUtility(int index)
Returns the utility of the bid for the i'th agent (agent A = 0, etc.).

Parameters:
index - of the agent of which the utility should be returned.
Returns:
utility of the bid for the i'th agent.

getUtilityA

public java.lang.Double getUtilityA()
Returns the utility of the bid for agent A.

Returns:
utility for agent A.

getUtilityB

public java.lang.Double getUtilityB()
Returns the utility of the bid for agent B.

Returns:
utility for agent B.

isStrictlyDominatedBy

public boolean isStrictlyDominatedBy(BidPoint other)
Returns true if this BidPoint is strictly dominated by another BidPoint. A BidPoint is dominated when the utility of the other bid for at least one agent is higher and equal for the other agent.

Parameters:
other - BidPoint.
Returns:
true if "other" dominates "this".

getDistance

public double getDistance(BidPoint other)
Returns the distance between this BidPoint and another BidPoint. sqrt((Tx - Ox) ^ 2 + (Ty - Oy) ^ 2 + ...).

Parameters:
other - bidpoint to which the distance is calculated.
Returns:
distance to the given bidpoint.